﻿//-----------------------------------------------------------------------
// <copyright file="SQLiteDataParameter.cs" company="NextLine Software">
//     Copyright (c) NextLine Software. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace NextLine.Data.SQLite
{
    using System;
    using System.Data;

    public class SQLiteDataParameter : IDbDataParameter
    {
        private string name;
        private object value;

        public SQLiteDataParameter(string name, object value)
        {
            this.name = name;
            this.value = value;
        }

        public SQLiteDataParameter(object value)
            : this(null, value)
        {
        }

        public byte Precision
        {
            get
            {
                throw new NotSupportedException();
            }

            set
            {
                throw new NotSupportedException();
            }
        }

        public byte Scale
        {
            get
            {
                throw new NotSupportedException();
            }

            set
            {
                throw new NotSupportedException();
            }
        }

        public int Size
        {
            get
            {
                throw new NotSupportedException();
            }

            set
            {
                throw new NotSupportedException();
            }
        }

        public DbType DbType
        {
            get
            {
                throw new NotImplementedException();
            }

            set
            {
                throw new NotImplementedException();
            }
        }

        public ParameterDirection Direction
        {
            get;
            set;
        }

        public bool IsNullable
        {
            get
            {
                return true;
            }
        }

        public string ParameterName
        {
            get
            {
                return this.name;
            }

            set
            {
                this.name = value;
            }
        }

        public string SourceColumn
        {
            get
            {
                throw new NotSupportedException();
            }

            set
            {
                throw new NotSupportedException();
            }
        }

        public DataRowVersion SourceVersion
        {
            get
            {
                throw new NotSupportedException();
            }

            set
            {
                throw new NotSupportedException();
            }
        }

        public object Value
        {
            get
            {
                return this.value;
            }

            set
            {
                this.value = value;
            }
        }
    }
}
